package org.greenwire.webislandharvester.action;

import java.util.HashMap;
import java.util.Map;

import org.greenwire.islandharvester.HappyIslandAutoHarvester;

import com.opensymphony.xwork2.ActionSupport;

public class HarvesterAction extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8462216046882712481L;
	
	private String userName;	
	private String passwd;
	
	private static Map<String, String> userNamePasswd = new HashMap<String, String>();
	
	static {
		userNamePasswd.put("reed7", "forkitty29");
		userNamePasswd.put("淡泊如茶", "kitty19790125");
	}

	public String execute() throws Exception {
		HappyIslandAutoHarvester hih = new HappyIslandAutoHarvester(userName, userNamePasswd.get(userName));
		hih.begin();
		return SUCCESS;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}	
}
